/*
 * Created by: 	Zhaoningbo
 * at:			2011-8-16 - 上午11:49:30
 * blog:		(http://zhaoningbo.iteye.com/)
 */
package com.gc.action;

import java.io.Serializable;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class Log implements Serializable, ApplicationContextAware {

    private static final long serialVersionUID = 5499459282971326224L;
    
    // To share applicationContext
    private ApplicationContext applicationContext;

    public void setApplicationContext(ApplicationContext applicationContext)
            throws BeansException {
        this.applicationContext = applicationContext;
    }
    
    // Publish this Event
    public int log(String log){
        LogEvent logEvent = new LogEvent(log);
        this.applicationContext.publishEvent(logEvent);
        return 0;
    }

}
